<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>主页面</title>
    <link rel="stylesheet" href="/js/elementui/index.css">
</head>
<body>
<div id="app">
<el-container style="height: 500px; border: 1px solid #eee">
    <!--顶部菜单-->
    <el-header style="text-align: right; font-size: 12px">
        <el-dropdown>
            <i class="el-icon-setting" style="margin-right: 15px"></i>
            <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>查看</el-dropdown-item>
                <el-dropdown-item>新增</el-dropdown-item>
                <el-dropdown-item>删除</el-dropdown-item>
            </el-dropdown-menu>
        </el-dropdown>
        <span>王小虎</span>
    </el-header>

    <el-container>
        <!--左侧导航-->
        <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
            <el-menu>
                <el-submenu :index="fun.id" v-for="fun in functions">
                    <template slot="title">
                        <i :class="fun.icon"></i>{{fun.name}}
                    </template>
                    <el-menu-item-group>
                        <el-menu-item :index="cfun.id" v-for="cfun in fun.subFunctions">
                            <!--超链接的target是跳转的目标，设置为iframe的name-->
                            <a :href="cfun.url" target="main">{{cfun.name}}</a>
                        </el-menu-item>
                    </el-menu-item-group>
                </el-submenu>
            </el-menu>
        </el-aside>
        <!--右侧列表-->
        <el-main>
            <iframe name="main" style="width: 100%;height:100%;border:0px"></iframe>
        </el-main>
    </el-container>
</el-container>
</div>
<style>
    .el-header {
        background-color: #B3C0D1;
        color: #333;
        line-height: 60px;
    }

    .el-aside {
        color: #333;
    }
</style>
<script src="/js/vue/vue.js"></script>
<script src="/js/axios/axios.min.js"></script>
<script src="/js/qs/qs.min.js"></script>
<script src="/js/elementui/index.js"></script>
<script>
    new Vue( {
        el:"#app",
        data() {
            return {
                functions:null
            }
        },
        mounted(){
            axios.get("/functions/username").then(value => {
                if(value.data.code == 1){
                    this.functions = value.data.data;
                }
            })
        }
    });
</script>

</body>
</html>